﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Legend.Component.Interface;
using Microsoft.Xna.Framework.Content;

namespace Legend.Component.Common
{
    public abstract class Movement : Interface.IMovement
    {
        private Quaternion rotateQuaternion = Quaternion.Identity;
        
        public override void Rotate(Vector3 axis, float rotateRadian)
        {
            rotateQuaternion *= Quaternion.CreateFromAxisAngle(axis, rotateRadian);
        }

        public override Matrix GetTransform()
        {
            Matrix worldMatrix;

            worldMatrix = Matrix.CreateFromQuaternion(rotateQuaternion);
            worldMatrix.Translation = Position;
            return worldMatrix;
        }
    }
}
